# Maintainer : Mike Krüger <mikekrueger81@gmail.com>

_name=thunar-shares-plugin
pkgname=thunar-shares-plugin-swagarch
pkgver=0.3.0
pkgrel=8
pkgdesc="Thunar plugin to quickly share a folder using Samba without requiring root access (with auto-setup)"
arch=('x86_64')
url="http://goodies.xfce.org/projects/thunar-plugins/${_name}"
license=('GPL2' 'LGPL')
depends=('thunar' 'samba' 'thunarx-python')
makedepends=('xfce4-dev-tools')
backup=('etc/samba/smb.conf')
provides=("${_name}=${pkgver}")
conflicts=("${_name}")
install="${pkgname}.install"
source=("https://git.xfce.org/thunar-plugins/thunar-shares-plugin/snapshot/thunar-shares-plugin-${pkgver}.tar.gz"
        "smb.conf")
sha1sums=('0c8d6f50701755f2db4b42f89b89f0f0fc2fc1f3'
          '9edd4e9d59636b1b32436e55c5a030c004784fb5')

build() {
    cd "${srcdir}/${_name}-${pkgver}"
    ./autogen.sh --prefix=/usr --enable-debug=no
    make
}

package() {
    cd "${srcdir}/${_name}-${pkgver}"
    make DESTDIR="${pkgdir}" install
  
    install -Dm644 "${srcdir}/smb.conf" "${pkgdir}/etc/samba/smb.conf"
    mkdir -p "${pkgdir}/var/lib/samba/usershare"
    chmod 1770 "${pkgdir}/var/lib/samba/usershare"
}

